---
title: Guide Documents > S/W Development Kit > Distribution
---
import { Tabs } from 'nextra/components'

```typescript copy filename="nestia.config.ts" showLineNumbers {19}
import { INestiaConfig } from "@nestia/sdk";
import { NestFactory } from "@nestjs/core";
// import { FastifyAdapter } from "@nestjs/platform-fastify";

import { YourModule } from "./src/YourModule";

const NESTIA_CONFIG: INestiaConfig = {
  input: async () => {
    const app = await NestFactory.create(YourModule);
    // const app = await NestFactory.create(YourModule, new FastifyAdapter());
    // app.setGlobalPrefix("api");
    // app.enableVersioning({
    //     type: VersioningType.URI,
    //     prefix: "v",
    // })
    return app;
  },
  output: "src/api",
  distribute: "packages/api",
};
export default NESTIA_CONFIG;
```

The best to way to distributing SDK library is just publishing as an NPM module.

Configure `distribute` property of [`nestia.config.ts`](#nestiaconfigts) file, and run `npx nestia sdk` command. After that, distribution environments would be automatically composed with SDK library generation. At last, move to the `packages/api` directory, and run `npm run deploy` command for publishing.

From now on, client developers can use the SDK library just by using `npm install` command.

```bash filename="deploy.sh" copy showLineNumbers
cd packages/api
npm run deploy
```

Of course, before publishing the NPM module, you've to customize some configurations like package name. Initial name of the distribution environments is `@ORGANIZATION/PROJECT-api`, but you must change the package name of yours, isn't it?

Also, if your SDK library utilize special alias `paths`, you also need to customize `tsconfig.json` file, too. Reading below example `package.json` and `tsconfig.json` files generated by `nestia`, consider which features to customize.

<Tabs items={[
  <code>package.json</code>, 
  <code>tsconfig.json</code>,
]}>
  <Tabs.Tab>
```json filename="package.json" showLineNumbers {2}
{
  "name": "@ORGANIZATION/PROJECT-api",
  "version": "0.1.0",
  "description": "SDK library generated by Nestia",
  "main": "lib/index.js",
  "typings": "lib/index.d.ts",
  "scripts": {
    "build": "npm run build:sdk && npm run compile",
    "build:sdk": "rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api",
    "compile": "rimraf lib && tsc",
    "deploy": "npm run build && npm publish"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/samchon/nestia"
  },
  "author": "Jeongho Nam",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/samchon/nestia/issues"
  },
  "homepage": "https://nestia.io",
  "devDependencies": {
    "rimraf": "^5.0.0",
    "typescript": "^5.4.2",
    "ts-patch": "^3.1.0"
  },
  "dependencies": {
    "@nestia/fetcher": "^4.2.0",
    "typia": "^8.0.0"
  },
  "files": [
    "lib",
    "package.json",
    "README.md"
  ]
}
```
  </Tabs.Tab>
  <Tabs.Tab>
```json filename="tsconfig.json" showLineNumbers
{
  "compilerOptions": {
    "target": "ES5",
    "lib": [
      "DOM",
      "ES2015"
    ],
    "module": "commonjs",
    "declaration": true,
    "sourceMap": true,
    "outDir": "./lib",
    "downlevelIteration": true,
    "newLine": "lf",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  },
  "include": [
    "../../src/api"
  ]
}

```
  </Tabs.Tab>
</Tabs>